package com.harveyguo.nihonngo.model.entity;

import com.harveyguo.nihonngo.enums.Gender;
import com.harveyguo.nihonngo.enums.UserType;
import jakarta.persistence.*;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * @Author：HarveyGuo
 * @Package：com.harveyguo.nihonngo.model
 * @Project：BestReading_back
 * @name：User
 *            @Date：2023/2/15 16:22
 * @Filename：User
 * @Describe：Do something
 */

@Entity
@Data
@Table(name = "users")
@Inheritance(strategy = InheritanceType.JOINED)
public class User extends BaseUserEntity {

    @Column(unique = true)
    private String username;

    private String nickname;

    private String password;

    private String email;

    private String phone;

    private String avatar;

    @Enumerated(EnumType.STRING)
    private Gender gender;

    @Enumerated(EnumType.STRING)
    private UserType userType = UserType.USER;

    private Boolean locked = false;

    private Boolean enabled = true;

    private String lastLoginIp;

    private Date lastLoginTime = new Date();

    // 拳击相关字段
    private Integer age;

    private Double weight; // 体重(kg)

    private Double height; // 身高(cm)

    private String boxingLevel; // 拳击水平：初学者、进阶、专业

    private Integer experienceYears; // 拳击经验年数

    private String preferredStyle; // 偏好风格：进攻型、防守型、技术型

    private String introduction; // 个人介绍

    private String token; // 用户token

    private Double latitude; // 纬度

    private Double longitude; // 经度

    // 角色 权限不需要给，User层只查角色，
    // @ManyToMany(cascade = {},fetch = FetchType.LAZY)
    // @JoinTable(name="user_role",joinColumns =
    // {@JoinColumn(name="user_id",referencedColumnName = "id")},inverseJoinColumns
    // = {@JoinColumn(name="role_id",referencedColumnName = "id")})
    // private List<Role> roles;

}
